package com.xlh.controller.file;

import com.xlh.common.Result;
import com.xlh.service.file.FileService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件数据转换接口,以后文件转换接口可写在此类下
 *
 * @author zhr 2019/11/15
 */
@RestController
@RequestMapping("/file")
public class FileController {

    @Autowired
    private FileService fileService;

    @PostMapping("/word2markdown")
    public Result<String> word2markdown(@RequestParam(value = "file") @ApiParam(value = "上传的文件", required = true) MultipartFile file) {
        return Result.success(fileService.word2markdown(file));
    }
}
